package com.cmcc.driver.ui.main.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.cmcc.driver.ui.main.DriverMainActivity

/**
 * Author: jiangxin
 * Date: 2019/11/5
 * Description:
 */
class MainViewPagerAdapter(private val fragments: List<Fragment>, activity: DriverMainActivity) :
    FragmentStateAdapter(activity) {


    override fun getItem(position: Int): Fragment {
        return fragments[position]
    }

    override fun getItemCount(): Int {
        return fragments.size
    }

}